<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module RSS::BaseModel - rss: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="Utils.html">RSS::Utils</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-boolean_writer">#boolean_writer</a>
    <li ><a href="#method-i-content_writer">#content_writer</a>
    <li ><a href="#method-i-convert_attr_reader">#convert_attr_reader</a>
    <li ><a href="#method-i-csv_attr_reader">#csv_attr_reader</a>
    <li ><a href="#method-i-csv_integer_writer">#csv_integer_writer</a>
    <li ><a href="#method-i-csv_writer">#csv_writer</a>
    <li ><a href="#method-i-date_writer">#date_writer</a>
    <li ><a href="#method-i-def_children_accessor">#def_children_accessor</a>
    <li ><a href="#method-i-explicit_clean_other_attr_reader">#explicit_clean_other_attr_reader</a>
    <li ><a href="#method-i-explicit_clean_other_writer">#explicit_clean_other_writer</a>
    <li ><a href="#method-i-inherit_convert_attr_reader">#inherit_convert_attr_reader</a>
    <li ><a href="#method-i-install_date_element">#install_date_element</a>
    <li ><a href="#method-i-install_element">#install_element</a>
    <li ><a href="#method-i-install_have_attribute_element">#install_have_attribute_element</a>
    <li ><a href="#method-i-install_have_child_element">#install_have_child_element</a>
    <li ><a href="#method-i-install_have_children_element">#install_have_children_element</a>
    <li ><a href="#method-i-install_text_element">#install_text_element</a>
    <li ><a href="#method-i-integer_writer">#integer_writer</a>
    <li ><a href="#method-i-itunes_episode_type_writer">#itunes_episode_type_writer</a>
    <li ><a href="#method-i-itunes_episode_writer">#itunes_episode_writer</a>
    <li ><a href="#method-i-positive_integer_writer">#positive_integer_writer</a>
    <li ><a href="#method-i-text_type_writer">#text_type_writer</a>
    <li ><a href="#method-i-uri_convert_attr_reader">#uri_convert_attr_reader</a>
    <li ><a href="#method-i-yes_other_attr_reader">#yes_other_attr_reader</a>
    <li ><a href="#method-i-yes_other_writer">#yes_other_writer</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-RSS::BaseModel">
    <h1 id="module-RSS::BaseModel" class="module">
      module RSS::BaseModel
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-install_date_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_date_element</span><span
                                class="method-args">(tag_name, uri, occurs, name=nil, type=nil, disp_name=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_date_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 279</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_date_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">occurs</span>, <span class="ruby-identifier">name</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">type</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-keyword">nil</span>)
      <span class="ruby-identifier">name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">tag_name</span>
      <span class="ruby-identifier">type</span> <span class="ruby-operator">||=</span> <span class="ruby-value">:w3cdtf</span>
      <span class="ruby-identifier">disp_name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">name</span>
      <span class="ruby-keyword">self</span><span class="ruby-operator">::</span><span class="ruby-constant">ELEMENTS</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">name</span>
      <span class="ruby-identifier">add_need_initialize_variable</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">install_model</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">occurs</span>, <span class="ruby-identifier">name</span>)

      <span class="ruby-comment"># accessor</span>
      <span class="ruby-identifier">convert_attr_reader</span> <span class="ruby-identifier">name</span>
      <span class="ruby-identifier">date_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">disp_name</span>)

      <span class="ruby-identifier">install_element</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">elem_name</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">&lt;&lt;-EOC</span>
<span class="ruby-value">        if @#{n}
          rv = &quot;\#{indent}&lt;#{elem_name}&gt;&quot;
          value = CGI.escapeHTML(@#{n}.#{type}.to_s)
          if need_convert
            rv &lt;&lt; convert(value)
          else
            rv &lt;&lt; value
          end
            rv &lt;&lt; &quot;&lt;/#{elem_name}&gt;&quot;
          rv
        else
          &#39;&#39;
        end
</span><span class="ruby-identifier">EOC</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_have_attribute_element" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">install_have_attribute_element</span><span
                                class="method-args">(tag_name, uri, occurs, name=nil, type=nil)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="BaseModel.html#method-i-install_have_child_element">install_have_child_element</a>
                            </div>
                          </div>

                  <div id="method-i-install_have_child_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_have_child_element</span><span
                                class="method-args">(tag_name, uri, occurs, name=nil, type=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_have_child_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 205</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_have_child_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">occurs</span>, <span class="ruby-identifier">name</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">type</span>=<span class="ruby-keyword">nil</span>)
      <span class="ruby-identifier">name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">tag_name</span>
      <span class="ruby-identifier">add_need_initialize_variable</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">install_model</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">occurs</span>, <span class="ruby-identifier">name</span>)

      <span class="ruby-identifier">writer_type</span>, <span class="ruby-identifier">reader_type</span> = <span class="ruby-identifier">type</span>
      <span class="ruby-identifier">def_corresponded_attr_writer</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">writer_type</span>
      <span class="ruby-identifier">def_corresponded_attr_reader</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">reader_type</span>
      <span class="ruby-identifier">install_element</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">elem_name</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">&lt;&lt;-EOC</span>
<span class="ruby-value">        if @#{n}
          &quot;\#{@#{n}.to_s(need_convert, indent)}&quot;
        else
          &#39;&#39;
        end
</span><span class="ruby-identifier">EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="BaseModel.html#method-i-install_have_attribute_element">install_have_attribute_element</a>
                            </div>

                          </div>

                  <div id="method-i-install_have_children_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_have_children_element</span><span
                                class="method-args">(tag_name, uri, occurs, name=nil, plural_name=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_have_children_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 225</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_have_children_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">occurs</span>, <span class="ruby-identifier">name</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">plural_name</span>=<span class="ruby-keyword">nil</span>)
      <span class="ruby-identifier">name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">tag_name</span>
      <span class="ruby-identifier">plural_name</span> <span class="ruby-operator">||=</span> <span class="ruby-node">&quot;#{name}s&quot;</span>
      <span class="ruby-identifier">add_have_children_element</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">plural_name</span>)
      <span class="ruby-identifier">add_plural_form</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">plural_name</span>)
      <span class="ruby-identifier">install_model</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">occurs</span>, <span class="ruby-identifier">plural_name</span>, <span class="ruby-keyword">true</span>)

      <span class="ruby-identifier">def_children_accessor</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">plural_name</span>)
      <span class="ruby-identifier">install_element</span>(<span class="ruby-identifier">name</span>, <span class="ruby-string">&quot;s&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">elem_name</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">&lt;&lt;-EOC</span>
<span class="ruby-value">        rv = []
        @#{n}.each do |x|
          value = &quot;\#{x.to_s(need_convert, indent)}&quot;
          rv &lt;&lt; value if /\\A\\s*\\z/ !~ value
        end
        rv.join(&quot;\n&quot;)
</span><span class="ruby-identifier">EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_text_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_text_element</span><span
                                class="method-args">(tag_name, uri, occurs, name=nil, type=nil, disp_name=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_text_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 245</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_text_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">occurs</span>, <span class="ruby-identifier">name</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">type</span>=<span class="ruby-keyword">nil</span>,
                             <span class="ruby-identifier">disp_name</span>=<span class="ruby-keyword">nil</span>)
      <span class="ruby-identifier">name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">tag_name</span>
      <span class="ruby-identifier">disp_name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">name</span>
      <span class="ruby-keyword">self</span><span class="ruby-operator">::</span><span class="ruby-constant">ELEMENTS</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">name</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">self</span><span class="ruby-operator">::</span><span class="ruby-constant">ELEMENTS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">add_need_initialize_variable</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">install_model</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">occurs</span>, <span class="ruby-identifier">name</span>)

      <span class="ruby-identifier">def_corresponded_attr_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">disp_name</span>)
      <span class="ruby-identifier">def_corresponded_attr_reader</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type</span> <span class="ruby-operator">||</span> <span class="ruby-value">:convert</span>)
      <span class="ruby-identifier">install_element</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">elem_name</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">&lt;&lt;-EOC</span>
<span class="ruby-value">        if respond_to?(:#{n}_content)
          content = #{n}_content
        else
          content = @#{n}
        end
        if content
          rv = &quot;\#{indent}&lt;#{elem_name}&gt;&quot;
          value = CGI.escapeHTML(content.to_s)
          if need_convert
            rv &lt;&lt; convert(value)
          else
            rv &lt;&lt; value
          end
            rv &lt;&lt; &quot;&lt;/#{elem_name}&gt;&quot;
          rv
        else
          &#39;&#39;
        end
</span><span class="ruby-identifier">EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-boolean_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">boolean_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="boolean_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 498</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">boolean_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">      def #{name}=(new_value)
        if new_value.nil?
          @#{name} = new_value
        else
          if @do_validate and
              ![true, false, &quot;true&quot;, &quot;false&quot;].include?(new_value)
            raise NotAvailableValueError.new(&#39;#{disp_name}&#39;, new_value)
          end
          if [true, false].include?(new_value)
            @#{name} = new_value
          else
            @#{name} = new_value == &quot;true&quot;
          end
        end
      end
</span><span class="ruby-identifier">EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-content_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">content_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="content_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 530</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">content_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">klass_name</span> = <span class="ruby-node">&quot;self.class::#{Utils.to_class_name(name)}&quot;</span>
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">      def #{name}=(new_value)
        if new_value.is_a?(#{klass_name})
          @#{name} = new_value
        else
          @#{name} = #{klass_name}.new
          @#{name}.content = new_value
        end
      end
</span><span class="ruby-identifier">EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-convert_attr_reader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">convert_attr_reader</span><span
                                class="method-args">(*attrs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="convert_attr_reader-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 364</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">convert_attr_reader</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
      <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{attr}
          convert(@#{attr})
        end
</span><span class="ruby-identifier">EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-csv_attr_reader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">csv_attr_reader</span><span
                                class="method-args">(*attrs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="csv_attr_reader-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 396</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">csv_attr_reader</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
      <span class="ruby-identifier">separator</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
        <span class="ruby-identifier">options</span> = <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">pop</span>
        <span class="ruby-identifier">separator</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:separator</span>]
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">separator</span> <span class="ruby-operator">||=</span> <span class="ruby-string">&quot;, &quot;</span>
      <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">          attr_reader(:#{attr})
          def #{attr}_content
            if @#{attr}.nil?
              @#{attr}
            else
              @#{attr}.join(#{separator.dump})
            end
          end
</span><span class="ruby-identifier">        EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-csv_integer_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">csv_integer_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="csv_integer_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 572</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">csv_integer_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{name}=(new_value)
          @#{name} = Utils::CSV.parse(new_value) {|v| Integer(v)}
        end
</span><span class="ruby-identifier">      EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-csv_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">csv_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="csv_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 564</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">csv_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{name}=(new_value)
          @#{name} = Utils::CSV.parse(new_value)
        end
</span><span class="ruby-identifier">      EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-date_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">date_writer</span><span
                                class="method-args">(name, type, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="date_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 417</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">date_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">      def #{name}=(new_value)
        if new_value.nil?
          @#{name} = new_value
        elsif new_value.kind_of?(Time)
          @#{name} = new_value.dup
        else
          if @do_validate
            begin
              @#{name} = Time.__send__(&#39;#{type}&#39;, new_value)
            rescue ArgumentError
              raise NotAvailableValueError.new(&#39;#{disp_name}&#39;, new_value)
            end
          else
            @#{name} = nil
            if /\\A\\s*\\z/ !~ new_value.to_s
              begin
                unless Date._parse(new_value, false).empty?
                  @#{name} = Time.parse(new_value)
                end
              rescue ArgumentError
              end
            end
          end
        end

        # Is it need?
        if @#{name}
          class &lt;&lt; @#{name}
            undef_method(:to_s)
            alias_method(:to_s, :#{type})
          end
        end

      end
</span><span class="ruby-identifier">EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-def_children_accessor" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_children_accessor</span><span
                                class="method-args">(accessor_name, plural_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="def_children_accessor-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 604</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">def_children_accessor</span>(<span class="ruby-identifier">accessor_name</span>, <span class="ruby-identifier">plural_name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">      def #{plural_name}
        @#{accessor_name}
      end

      def #{accessor_name}(*args)
        if args.empty?
          @#{accessor_name}.first
        else
          @#{accessor_name}[*args]
        end
      end

      def #{accessor_name}=(*args)
        receiver = self.class.name
        warn(&quot;Don&#39;t use `\#{receiver}\##{accessor_name} = XXX&#39;/&quot; \
             &quot;`\#{receiver}\#set_#{accessor_name}(XXX)&#39;. &quot; \
             &quot;Those APIs are not sense of Ruby. &quot; \
             &quot;Use `\#{receiver}\##{plural_name} &lt;&lt; XXX&#39; instead of them.&quot;, uplevel: 1)
        if args.size == 1
          @#{accessor_name}.push(args[0])
        else
          @#{accessor_name}.__send__(&quot;[]=&quot;, *args)
        end
      end
      alias_method(:set_#{accessor_name}, :#{accessor_name}=)
</span><span class="ruby-identifier">EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-explicit_clean_other_attr_reader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">explicit_clean_other_attr_reader</span><span
                                class="method-args">(*attrs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="explicit_clean_other_attr_reader-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 374</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">explicit_clean_other_attr_reader</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
      <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">          attr_reader(:#{attr})
          def #{attr}?
            Utils::ExplicitCleanOther.parse(@#{attr})
          end
</span><span class="ruby-identifier">        EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-explicit_clean_other_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">explicit_clean_other_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="explicit_clean_other_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 544</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">explicit_clean_other_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{name}=(value)
          value = (value ? &quot;yes&quot; : &quot;no&quot;) if [true, false].include?(value)
          @#{name} = value
        end
</span><span class="ruby-identifier">      EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inherit_convert_attr_reader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inherit_convert_attr_reader</span><span
                                class="method-args">(*attrs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="inherit_convert_attr_reader-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 324</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inherit_convert_attr_reader</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
      <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{attr}_without_inherit
          convert(@#{attr})
        end

        def #{attr}
          if @#{attr}
            #{attr}_without_inherit
          elsif @parent
            @parent.#{attr}
          else
            nil
          end
        end
</span><span class="ruby-identifier">EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_element</span><span
                                class="method-args">(name, postfix=&quot;&quot;)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 312</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_element</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">postfix</span>=<span class="ruby-string">&quot;&quot;</span>)
      <span class="ruby-identifier">elem_name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-string">&#39;_&#39;</span>, <span class="ruby-string">&#39;:&#39;</span>)
      <span class="ruby-identifier">method_name</span> = <span class="ruby-node">&quot;#{name}_element#{postfix}&quot;</span>
      <span class="ruby-identifier">add_to_element_method</span>(<span class="ruby-identifier">method_name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">      def #{method_name}(need_convert=true, indent=&#39;&#39;)
        #{yield(name, elem_name)}
      end
      private :#{method_name}
</span><span class="ruby-identifier">EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-integer_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">integer_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="integer_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 456</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">integer_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">      def #{name}=(new_value)
        if new_value.nil?
          @#{name} = new_value
        else
          if @do_validate
            begin
              @#{name} = Integer(new_value)
            rescue ArgumentError
              raise NotAvailableValueError.new(&#39;#{disp_name}&#39;, new_value)
            end
          else
            @#{name} = new_value.to_i
          end
        end
      end
</span><span class="ruby-identifier">EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-itunes_episode_type_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">itunes_episode_type_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="itunes_episode_type_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 592</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">itunes_episode_type_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-DEF</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{name}=(new_value)
          if @do_validate and
               ![&quot;Full&quot;, &quot;Trailer&quot;, &quot;Bonus&quot;, nil].include?(new_value)
            raise NotAvailableValueError.new(&#39;#{disp_name}&#39;, new_value)
          end
          @#{name} = new_value
        end
</span><span class="ruby-identifier">      DEF</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-itunes_episode_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">itunes_episode_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="itunes_episode_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 580</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">itunes_episode_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{name}=(new_value)
          if @do_validate and
               ![&quot;episodic&quot;, &quot;serial&quot;, nil].include?(new_value)
            raise NotAvailableValueError.new(&#39;#{disp_name}&#39;, new_value)
          end
          @#{name} = new_value
        end
</span><span class="ruby-identifier">      EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-positive_integer_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">positive_integer_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="positive_integer_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 476</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">positive_integer_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">      def #{name}=(new_value)
        if new_value.nil?
          @#{name} = new_value
        else
          if @do_validate
            begin
              tmp = Integer(new_value)
              raise ArgumentError if tmp &lt;= 0
              @#{name} = tmp
            rescue ArgumentError
              raise NotAvailableValueError.new(&#39;#{disp_name}&#39;, new_value)
            end
          else
            @#{name} = new_value.to_i
          end
        end
      end
</span><span class="ruby-identifier">EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-text_type_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">text_type_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="text_type_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 518</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">text_type_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">      def #{name}=(new_value)
        if @do_validate and
            ![&quot;text&quot;, &quot;html&quot;, &quot;xhtml&quot;, nil].include?(new_value)
          raise NotAvailableValueError.new(&#39;#{disp_name}&#39;, new_value)
        end
        @#{name} = new_value
      end
</span><span class="ruby-identifier">EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-uri_convert_attr_reader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">uri_convert_attr_reader</span><span
                                class="method-args">(*attrs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="uri_convert_attr_reader-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 344</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">uri_convert_attr_reader</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
      <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{attr}_without_base
          convert(@#{attr})
        end

        def #{attr}
          value = #{attr}_without_base
          return nil if value.nil?
          if /\\A[a-z][a-z0-9+.\\-]*:/i =~ value
            value
          else
            &quot;\#{base}\#{value}&quot;
          end
        end
</span><span class="ruby-identifier">EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-yes_other_attr_reader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">yes_other_attr_reader</span><span
                                class="method-args">(*attrs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="yes_other_attr_reader-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 385</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">yes_other_attr_reader</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
      <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
<span class="ruby-value">          attr_reader(:#{attr})
          def #{attr}?
            Utils::YesOther.parse(@#{attr})
          end
</span><span class="ruby-identifier">        EOC</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-yes_other_writer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">yes_other_writer</span><span
                                class="method-args">(name, disp_name=name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="yes_other_writer-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/rss.rb, line 553</span>
    <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">yes_other_writer</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">disp_name</span>=<span class="ruby-identifier">name</span>)
      <span class="ruby-identifier">module_eval</span>(<span class="ruby-identifier">&lt;&lt;-EOC</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">get_file_and_line_from_caller</span>(<span class="ruby-value">2</span>))
<span class="ruby-value">        def #{name}=(new_value)
          if [true, false].include?(new_value)
            new_value = new_value ? &quot;yes&quot; : &quot;no&quot;
          end
          @#{name} = new_value
        end
</span><span class="ruby-identifier">      EOC</span>
    <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

